import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * Created by Administrator on 2018-9-29 0029.
 */
public class Thread2 {


    private static final int THREAD_POOL_SIZE = 5;

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Executor executor = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
        for (int i = 0; i < 10; i++) {
            executor.execute(new ThreadTest(list));
        }
    }

}
